package io.renren.sf.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 *
 *
 * @author txw_cyl
 * @email sunlightcs@gmail.com
 * @date 2022-04-22 20:37:21
 */
@Data
@Accessors(chain = true)
@TableName("hz_file")
public class HzFileEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 文件id
	 */
	@TableId(type = IdType.ID_WORKER)
	@ApiModelProperty(value = "文件id", dataType = "Long")
	private Long id;
	/**
	 * 上层文件id
	 */
	@ApiModelProperty(value = "上层文件id,0为根目录", dataType = "Long")
	private Long upperFid;
	/**
	 * 文件所属0：公共1：私人
	 */
	@ApiModelProperty(value = "文件所属0：公共1：私人", dataType = "Integer")
	private Integer fileBelongto;
	/**
	 * 文件类型0：目录1：文件
	 */
	@ApiModelProperty(value = "文件类型0：目录1：文件", dataType = "Integer")
	private Integer fileType;
	/**
	 * 文件地址src
	 */
	@ApiModelProperty(value = "文件地址src", dataType = "String")
	private String fileAddress;
	/**
	 * 文件大小
	 */
	@ApiModelProperty(value = "文件大小", dataType = "String")
	private String fileSize;
	/**
	 * 文件名称
	 */
	@ApiModelProperty(value = "文件名称", dataType = "String")
	private String fileName;
	/**
	 * 文件下载次数
	 */
	@ApiModelProperty(value = "文件下载次数", dataType = "Integer")
	private Integer fileLoaddownCount;
	/**
	 * 上传人老师id
	 */
	@ApiModelProperty(value = "上传人老师id", dataType = "Long")
	private Long tid;
	/**
	 * 单位名
	 */
	@ApiModelProperty(value = "单位名", dataType = "String")
	private String unitName;
	/**
	 * 教师名
	 */
	@ApiModelProperty(value = "教师名", dataType = "String")
	private String teacherName;
	/**
	 * 联系方式
	 */
	@ApiModelProperty(value = "联系方式", dataType = "String")
	private String phone;
	/**
	 * 审核状态0：未审核1：已审核2：审核失败
	 */
	@ApiModelProperty(value = "审核状态0：未审核1：已审核2：审核失败", dataType = "Integer")
	private Integer verifyState;
	/**
	 * 省地址id
	 */
	@ApiModelProperty(value = "省地址id", dataType = "Long")
	private Long pid;
	/**
	 * 市地址id
	 */
	@ApiModelProperty(value = "市地址id", dataType = "Long")
	private Long cid;
	/**
	 * 区/县地址id
	 */
	@ApiModelProperty(value = "区/县地址id", dataType = "Long")
	private Long aid;
	/**
	 * 审核失败原因
	 */
	@ApiModelProperty(value = "审核失败原因", dataType = "String")
	private String verifyFailReason;
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", dataType = "Date")
	private Date createTime;
	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间", dataType = "Date")
	private Date updateTime;

	public HzFileEntity() {

	}

	/**
	 * 私人资源新增文件夹
	 */
	public HzFileEntity(long upperFid, String fileName,long tid,int fileType){
		this.upperFid = upperFid;
		this.fileName = fileName;
		this.tid = tid;
		this.createTime = new Date();
		this.updateTime = this.createTime;
		this.fileBelongto = 1;
		this.fileType = fileType;
	}

	/**
	 * 私人资源新增文件
	 */
	public HzFileEntity(String fileAddress, long upperFid, String fileName,long tid,int fileType,String fileSize){
		this.fileAddress = fileAddress;
		this.upperFid = upperFid;
		this.fileName = fileName;
		this.tid = tid;
		this.createTime = new Date();
		this.updateTime = this.createTime;
		this.fileBelongto = 1;
		this.fileType = fileType;
		this.fileLoaddownCount = 0;
		this.fileSize = fileSize;
	}

	/**
	 * 私人资源提交到公共资源
	 */
	public HzFileEntity(String fileAddress, String fileName, String phone, String teacherName, String unitName,
						long pid,long cid,long aid,long tid,String fileSize){
		//文件地址、创建时间、修改时间、文件名称、审核状态
		this.fileAddress = fileAddress;
		this.createTime = new Date();
		this.updateTime = this.createTime;
		this.fileName = fileName;
		this.verifyState = 0;
		//联系方式、教师名、单位名、省、市、区/县id
		this.phone = phone;
		this.teacherName = teacherName;
		this.unitName = unitName;
		this.pid = pid;
		this.cid = cid;
		this.aid = aid;
		//上传老师id、文件下载次数、文件所属、文件类型
		this.tid = tid;
		this.fileLoaddownCount = 0;
		this.fileBelongto = 0;
		this.fileType = 1;
		this.fileSize = fileSize;
	}
}
